﻿using AnesSystem.Models;
using AnesSystem.Services;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AnesSystem.ViewModels
{
    class ConfigEventDataGridViewModel : BaseViewModel<ConfigEventDataGridViewModel>
    {
        #region Variables

        private ObservableCollection<ConfigEventsModel> _configEventsModel = new ObservableCollection<ConfigEventsModel>();

        #endregion

        #region Constructor

        public ConfigEventDataGridViewModel()
        {
            initConfigEventModel();
           
        }

        #endregion

        #region Properties
        
        public ObservableCollection<ConfigEventsModel> ConfigEventModels
        {
            get
            {
                return _configEventsModel;
            }
            set
            {
                _configEventsModel = value;
                RaisePropertyChanged("ConfigEventModels");
            }
        }

        #endregion

        #region Event

        #endregion

        #region Private Methods
        private void initConfigEventModel()
        {
            IEnumerable<ConfigEventsModel> list = ConfigEventModelService.Instance.FindAll();
            foreach (var item in list)
            {
                if (string.IsNullOrEmpty(item.Code))
                {
                    continue;
                }
                _configEventsModel.Add(item);
               
            }
        }

      

        #endregion

        #region Public/Protected Methods


        #endregion

        #region EventHandlers

        #endregion

        #region Command

        #region ChangeDoctorCommand

        #endregion

        #region OpenPopupCommand

        #endregion
        #endregion
    }
}
